(function (doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
        recalc = function () {
            if (docEl.clientWidth >= 1200) {
                var width = docEl.clientWidth / 24;
                docEl.style.fontSize = width+"px";
            }else if (docEl.clientWidth >= 750 && docEl.clientWidth < 1200 ) {
                var width = docEl.clientWidth / 18.75;
                docEl.style.fontSize = width + "px";
            } else {
                var width = docEl.clientWidth / 10;
                docEl.style.fontSize = width + "px";
            }
        };
    const debounce = (fn, delay) => {
        let timer;
        return function () {
            if (timer) {
                clearTimeout(timer);
            }
            timer = setTimeout(() => {
                fn();
            }, delay);
        }
    };
    recalc()
    const resizeWin = debounce(recalc, 500)
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, resizeWin, false);
    doc.addEventListener("DOMContentLoaded", resizeWin, false);
})(document, window);